package me.greyliu.kuai.controller;

import me.greyliu.kuai.entity.Response;
import me.greyliu.kuai.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@CrossOrigin(origins = "*")
public class UserController {
    @Autowired
    UserService userService;
    @PostMapping("user/login")
    @ResponseBody
    public Response login(String name,String pwd){
        return userService.login(name,pwd);
    }
    @PostMapping("user/regist")
    @ResponseBody
    public Response regist(String name,String pwd){
        return userService.regist(name,pwd);
    }
}
